package cn.wx.scholar;

public class ComputeIndex {

	public static void main(String[] args) {
		System.out.println(computeAindex(156, 280, 798, 1734, 153574, 851671, 2, 74));
	}

	private static Double computeAindex(Integer hindex,
			Integer maxhindex,
			Integer pnum,
			Integer maxpnum,
			Integer citations,
			Integer maxcitations,
			Integer bnum,
			Integer maxbnum) {
		Double log_hIndex = (hindex > maxhindex) ? 1D : Math.log(hindex + 1.0)/Math.log(maxhindex);
		Double log_pnum = (pnum > maxpnum) ? 1D : Math.log(pnum + 1.0)/Math.log(maxpnum);
		Double log_citations = (citations > maxcitations) ? 1D : Math.log(citations + 1.0)/Math.log(maxcitations);
		Double log_bnum = (bnum > maxbnum) ? 1D : Math.log(bnum + 1.0)/Math.log(maxbnum);
		return (log_hIndex * 0.25 + log_pnum * 0.35 + log_citations * 0.1 + log_bnum * 0.3) * 100;
	}
	
}
